<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<title>Login</title>
<script type="text/javascript" src="/resources/js/jquery-1.6.js"></script>
<script src="/resources/js/fancybox/jquery.fancybox-1.3.4.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="/resources/js/fancybox/jquery.fancybox-1.3.4.css"/>

      <script type="text/javascript">
	$(document).ready(function(){
		$("#remindPass").fancybox({
            'width'             : '75%',
            'height'            : '90%',
            'autoScale'         : false,
            'transitionIn'      : 'none',
            'transitionOut'     : 'none',
            'type'              : 'iframe'
        });


	})

	function closeIframe(reload) {
        	if (reload) {window.location.reload();}
        	$('#fancybox-wrap').hide('slow').remove();
            $('#fancybox-overlay').hide('slow').remove();

        }

	function remindPassword(){
	$("#remindPass").click();
	}
</script>

</head>

<body>

<!--	<c:if test="${not empty param.error}">
		<span style="color: red;"> Login error. <br /> Reason :
			${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message} </span>
	</c:if>
	<a align=right href="registrationWorker">registration for Workers</a> </br>
	<a align=right href="registrationEmployer">registration for Employers</a>
	<form class="three" method="POST" action="<c:url value="/j_spring_security_check" />">
		<table>
			<tr>
				<td align="right">Username</td>
				<td><input type="text" name="j_username" />
				</td>
			</tr>
			<tr>
				<td align="right">Password</td>
				<td><input type="password" name="j_password" />
				</td>
			</tr>

			<%--<a href="registration.jsp">Регистрация</a>--%>
			<tr>
				<td align="right">Remember me</td>
				<td><input type="checkbox" name="_spring_security_remember_me" />
				</td>
			</tr>
			<tr>
				<td colspan="2" align="right"><input type="submit"
					value="Login" /> <input type="reset" value="Reset" /></td>
			</tr>
			<tr>
				<td colspan="2" align="right"><input type="button"
					value="" /> <input type="reset" value="Reset" /></td>
			</tr>
		</table>
	</form>

	-->

	<div class="cont_login">
		<form class="three" method="POST" action="<c:url value="/j_spring_security_check" />">
			<div class="text_login_form" >Email</div>
			<input type="text" name="j_username" />
			<div class="text_login_form" >Пароль</div>
			<input type="password" name="j_password" />
			<c:if test="${not empty param.error}">
		        <div style="color: red;"> Ошибка: неверно указан логин или пароль. <br/>
		        Попробуйте снова.

		            <!--Reason : ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}-->
		        </div>
	        </c:if>
			<div class="text_login_form" ><input type="checkbox" name="_spring_security_remember_me" /> Запомнить меня
			</div>
            <div>
            <input type="submit" value="Войти" class="button black medium" >
            </div>
            <div>
            <input type="button" value="Забыли пароль?" class="button black medium" onclick="remindPassword()" >
            <a id="remindPass" href="/recovery/remindPass" style="display:none"></a>
            </div>
		</form>
	</div>
	<div style="position:absolute; left:500px; bottom:740px;">
	<div class="text_login_form" style="width:350px; float:none; font-size: 25px;" >Не зарегистрированы?</div>
	<a href="registrationWorker" class="button gray max">Ищу работу</a><br><br>
	<a href="registrationEmployer" class="button gray max">Ищу работников</a>
	</div>

</body>
</html>